# == Schema Information
#
# Table name: payments
#
#  id             :integer          not null, primary key
#  payment_method :string(255)      not null                  # 支付方式
#  amount         :decimal(10, 2)   default("0.00"), not null # 支付总金额
#  rescue_id      :integer                                    # 关联救援
#  time_paid      :datetime         not null
#  transaction_no :string(255)      not null                  # 交易号
#  charge_id      :string(255)      not null                  # charge id
#  created_at     :datetime         not null
#  updated_at     :datetime         not null
#

class Payment < ActiveRecord::Base

  # 通用查询方法
  include Concerns::Query::Methods

  # 关联救援项目
  belongs_to :rescue

  module Status
    include Concerns::Dictionary::Module::I18n

    # 取消
    CANCELED = 0

    # 等待救援
    WAITING = 1

    # 救援成功
    DONE = 2

    # 支付成功
    PAY_SUCCESS = 3

    # 全部
    ALL = get_all_values
  end
end
